<script>
$j(function() {
	updatecart();
});
function updatecart() {
	$j.ajax({
		url: '<?=base_url()?>store/updatecart/',
		success: function(html) {
			$j('#cart-summary').html(html);
		}
	})
}
</script>		
        <?php $cat = $this->uri->segment(3);
			if ($this->uri->segment(1) != "store" || $this->uri->segment(2) != "category") { $cat = ""; }
			else { } ?>
        
    	<div id="leftbar"><div class="inside">
        	<h2 class="blue">Products Menu</h2>
            <p>Rollover buttons for more options</p>
            <ul class="leftnav">
            	<?php foreach($categories as $category) { ?>
                <li><img src="<?=base_url()?>img/icon-<?=$category['name']?>.png" />
                	<a href="<?=base_url()?>store/category/<?=$category['id']?>"<?php if ($cat==$category['id']) print 'class="current"'; ?>><?=$category['title']?></a>
                    <?php $subcategories = $this->Category_model->get($category['id']); 
					if ($subcategories) { ?>
                    <ul>
                    	<?php foreach($subcategories as $subcategory) { ?>
                       	<li><a href="<?=base_url()?>store/category/<?=$subcategory['id']?>"><?=$subcategory['title']?></a></li>
                        <?php } ?>
                    </ul>
                <?php } 
				} ?>            	
            </ul>
            <dl></dl>
            <div class="box-cart">
            	<h3>Your Shopping Trolly</h3>
                <div id="cart-summary"></div>
                <p><a href="<?=base_url()?>store/cart">Click to view your trolley</a></p>
            </div>
        </div></div>